<?php
/**
 * Formulaire de creation de news
 * @author Etienne AUDOUIN <etienne.audouin@ingesup.com>
 * @author Adrien MARIANELLI <adrien.marianelli@ingesup.com>
 * @version 1.0
 * @package view_news_create
 */
$formAttributes = array ('id' => 'form_createNewsletter');

echo form_fieldset('Create a new Newsletter');
echo form_open('webnews/createNewsletter', $formAttributes);
echo '<table id="table_createNewsletter">';

// titre
$data = array(
    'name'        => 'newsletterTitle',
    'id'          => 'input_newsletterTitle');

echo '<tr>';
echo '<th>Titre</th>';
echo '<td>'.form_input($data).'</td>';
echo '</tr>';

// body
$data = array(
    'name'        => 'newsletterBody',
    'id'          => 'input_newsletterBody');

echo '<tr>';
echo '<th>Lettre</th>';
echo '<td>'.form_textarea($data).'</td>';
echo '</tr>';

// signature
$data = array(
    'name'        => 'newsletterSignature',
    'id'          => 'input_newsletterSignature');

echo '<tr>';
echo '<th>Signature</th>';
echo '<td>'.form_input($data).'</td>';
echo '</tr>';

// mailinglists
$listAttributes = array ();
foreach ($lists as $list){
    $listAttributes[$list->id] = $list->name;
}

echo '<tr>';
echo '<th>Mailing list *</th>';
echo '<td>'.form_multiselect('multi_mailingLists[]', $listAttributes).'</td>';
echo '</tr>';
echo '</table>';

echo form_submit(null, 'Create');
echo form_close();
echo '<small>* Press <strong class="key">Maj</strong> or <strong class="key">Ctrl</strong> to select multiple contacts</small>';
echo form_fieldset_close();
?>